<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="<%=basePath%>js/jquery.cycle.all.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	   $('#pics').cycle({ 
		            fx:    'scrollRight' 
		           });
	   $("#info").hide();
	   var url = window.location.href; 
	   var array= url.split("/");
	   var len = array.length;
	   if(array[len-1]!="login")
		   {
		   $("#info").show();
		   }
	   $("#loginForm").validate({
		   rules:{
			   username:{
				   required:true,
				  
			   }
		   },
		   messages:{
			  mail:{
				  required:"<img alt='' src='<%=basePath%>images/error1.gif'>必填",
			  }
		   },errorPlacement: function(error, element) {                             //错误信息位置设置方法  
				 error.appendTo( element.next("span") );                            //这里的element是录入数据的对象  
			 }
	   });
   });
</script>
<div id="login" style='height:400px;'>
	<div class="span6 left" id="pics" >
	   <img alt="" src="<%=basePath%>images/1.jpg" />
	   <img alt="" src="<%=basePath%>images/2.jpg" />
	   <img alt="" src="<%=basePath%>images/3.jpg" />
	</div>
	<div class="span5 right">
	   <c:if test="${notlogin }">
	     <div class="info" id='info'>请先登录！！！</div>
	   </c:if>
	   <c:if test="${missPass }">
	      <div class="info">用户名或密码出错！</div>
	   </c:if>
		<form action="<%=basePath%>login"
			method="post" class="form-horizontal" id="loginForm">
			<div class="control-group">
				<label class="control-label" for="username">用户名:</label>
				<div class="controls">
					<input type="text" id="mail" name="username" placeholder="用户名">
					<span></span>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="inputPassword">密码:</label>
				<div class="controls">
					<input type="password" id="inputPassword" name="password"
						placeholder="密码">
				</div>
			</div>

			<div class="controls" style='margin-left:200px;'><input class="submit" type="submit" value="登录" />
		    </div>
		</form>
		</div>
</div>